package com.hmall.mapper;

import com.hmall.model.SysCustomer;
import com.hmall.model.SysUser;
import com.hmall.model.User;
import com.hmall.util.MyMapper;
import com.hmall.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Repository
public interface SysUserMapper extends MyMapper<SysUser> {

    int myInsert(@Param("sysUser") SysUser sysUser) ;

    SysUser simpleUserByUsername(@Param("username") String username);

    SysUser hardUserByUsername(@Param("username") String username);


    int checkUsername(@Param("userName") String userName);

    int checkEmail(@Param("email") String email);

    SysUser selectLogin(@Param("username") String username, @Param("password")String password);

    String selectQuestionByUsername(String username);

    int checkAnswer(@Param("username")String username,@Param("question")String question,@Param("answer")String answer);

    int updatePasswordByUsername(@Param("username")String username,@Param("passwordNew")String passwordNew);

    int checkPassword(@Param(value="password")String password,@Param("userId")Integer userId);

    int checkEmailByUserId(@Param(value="email")String email,@Param(value="userId")Integer userId);

    int selectIdByUsername(@Param(value="username")String username);


    SysUser selectByUserId(@Param("userId") Integer userId);

    SysUser selectByUserName1(@Param("username1") String username1);

    List<SysUser> selectAccout(@Param("accout") String accout);
    int deleteUser( @Param("userId") Integer userId);
    SysUser selectByUserName(@Param("username") String username);

    List<UserVo> selectMyUser(@Param("dept_id") Integer dept_id);

    List<UserVo> selectBySearch(@Param("dept_id") Integer dept_id,@Param("search") String search);

    Integer checkUsernameByUserId(@Param("username") String username,@Param("user_id") Integer user_id);

    List<SysUser> selectByDeptId(@Param("dept_id2") Integer dept_id2);

    int selectCountData(@Param("dept_id") Integer dept_id);

    List<UserMonthVo> selectByPage(@Param("dept_id") Integer dept_id,@Param("month") Integer month,@Param("year") Integer year);

    Integer checkPhone(@Param("phone") String phone);

    List<SalesmanVo> selectSalesMan(@Param("dept_id") Integer dept_id);

    String selectRoleName(@Param("user_id") Integer user_id);

    Integer selectByDeptIdAndTime(@Param("dept_id") Integer dept_id,@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    Integer selectByTime(@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    List<SysUser> selectGenDanList();

    List<RoleVo> getKefuList();

    String[] getCheckedKefuList(@Param("customer_id") Integer customer_id);

    List<SysUserBinding> selectBindingList(@Param("username") String username,@Param("real_name") String real_name,@Param("bus_name") String bus_name);

    Integer selectDealerIdByUserId(@Param("user_id") Integer user_id);
}